package com.cungmua.app.model;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;

/**
 * Created by kelvin.nguyen on 6/25/14.
 */
public class PaymentInfo {
    private List<ShippingAddress> addressList;

    public List<ShippingAddress> getAddressList() {
        return addressList;
    }

    @JsonProperty("ShipAddress")
    public void setAddressList(List<ShippingAddress> addressList) {
        this.addressList = addressList;
    }

    public ShippingAddress getDefaultAddress() {
        for (ShippingAddress addr : addressList) {
            if (addr.isDefaultAddress())
                return addr;
        }
        if (addressList != null && addressList.size() > 0)
            return addressList.get(0);

        return null;
    }
}